#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include "ui_mainwindow.h"

#include <phonon/audiooutput.h>
#include <phonon/seekslider.h>
#include <phonon/mediaobject.h>
#include <phonon/volumeslider.h>
#include <phonon/backendcapabilities.h>
#include <qlist.h>
 #include <QFileDialog>
 #include <QDesktopServices>
#include <QTime>

namespace Ui {
    class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();

private:
    Ui::MainWindow *ui;
    Phonon::MediaObject *media;
    Phonon::AudioOutput *audioOut;
     Phonon::MediaSource source;
     //seznam songu v playlistu
     QList<Phonon::MediaSource> sources;
     //inicializace GUI tabulky
     void initTable();
     //cislo pisnicky, ktera prave hraje (1. pisnicka ma cislo 0)
     int playingSong;


private slots:
     //slot pro ulozeni playlistu
    void on_pushButton_2Save_clicked();
    //slot pro nahrani playlistu
    void on_pushButtonload_clicked();
    void setTotal();
    void tick(qint64 time);
    void songFinished();
    void on_addButton_released();
    void on_pauseButton_released();
    void on_playButton_released();
    void on_stopButton_released();
    //po kliknuti na radek tabulky, prepne danou pisnicku
    void switchSong(int, int);
    //po dohrani prepne na dalsi pisnicku
    void nextSong();
    void stateChanged(Phonon::State newState, Phonon::State oldState);
};

#endif // MAINWINDOW_H
